<?php
/**
 * User: YL
 * Date: 2019/6/10
 */

namespace app\common\middleware;

use Closure;
use restful\RuntimeCipher;
use think\Request;

class Cipher
{
    public function handle(Request $request, Closure $next)
    {
        $params = RuntimeCipher::getInstance()->request();
        if (! empty($params)) {
            // 设置运行参数
            $request->runParams = $params;
        }

        return $next($request);
    }
}